package com.airtight.objects;


import com.airtight.programs.TextureShaderProgram;

import static android.opengl.Matrix.orthoM;

public class Shard extends Object{
    public final float[] shardMatrix = new float[16];
    public float transparency = 1f;

    public Shard(float x, float y, float width, float height) {
        super(x,y,width,height);
        orthoM(shardMatrix, 0, -1f, 1f, -1, 1, -1, 1f);
    }

    public void drawShard(TextureShaderProgram textureProgram, int asset){
        textureProgram.setTexture(shardMatrix, asset);
        textureProgram.setOpacity(transparency);
        bindData(textureProgram);
        draw();
    }

    public void Fade(){
        transparency -= 0.01f;
    }

    public float getX(){
        return shardMatrix[12];
    }

    public float getY(){
        return shardMatrix[13];
    }
}